<?php	
	require '../utils/conn.php';
	include_once '../models/set.php';
	
	$setId = $_REQUEST['setId'];
	$recommandId = $_REQUEST['recommandId'];
	$remark = $_REQUEST['remark'];
	
	$sql = "SELECT * FROM t_recommand_set WHERE r_id=$recommandId and s_id=$setId";
	$result = mysql_query($sql);
	
	if ($myrow = mysql_fetch_array($result)) {
		echo "error";
		return;
	}
	
	
	$query = "INSERT INTO t_recommand_set(r_id, s_id, remark)" . " VALUES($recommandId,$setId,$remark)";
	$result = mysql_query($query) or die("insert set failed：". mysql_error());
	echo mysql_insert_id();
?>